package com.mab.apipassenger.controller;

import com.mab.apipassenger.service.ForecastPriceService;
import com.msb.internalcommon.dto.ResponseResult;
import com.msb.internalcommon.request.ForecastPriceDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Auther: jiudianliu
 * @Date: 2023/6/2 - 06 - 02 - 13:39
 * @Description: com.mab.apipassenger.controller
 * @version: 1.0
 */
@RestController
@Slf4j
public class ForecastPriceController {

    @Autowired
    ForecastPriceService forecastPriceService ;


    @PostMapping("/forecast-price")
    public ResponseResult forecastPrice(@RequestBody  ForecastPriceDTO forecastPriceDTO){
        String depLongitude = forecastPriceDTO.getDepLongitude();
        String depLatitude = forecastPriceDTO.getDepLatitude();
        String destLongitude = forecastPriceDTO.getDestLongitude();
        String destLatitude = forecastPriceDTO.getDestLatitude();
        String cityCode = forecastPriceDTO.getCityCode();
        String vehicleType = forecastPriceDTO.getVehicleType();
        return forecastPriceService.forecastPrice(depLongitude , depLatitude , destLongitude , destLatitude , cityCode , vehicleType) ;
    }
}
